package com.goodfox.web.generic.provide.exception;

public enum EntityExpType {
	
	LENGTH("超过限制长度",1),DATATYPE("数据类型错误",2),REQUIRED("数据不能为空",2);
	
	private String name;
	private int index;
	
	private EntityExpType(String name,int index){
		this.name=name;
		this.index=index;
	}
	
	public static String getName(int index) {   
        for (EntityExpType e:EntityExpType.values()) {   
            if (e.getIndex() == index) {   
                return e.name;   
            }   
        }   
        return null;   
    }

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
	

}
